package com.example.testgit.VO;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: lyh
 * @create: 2023/3/20 10:25
 * Description：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {

    private String code;

    private String message;

    private T data;

    public static <T> Result<T> success(T data) {
        return new Result("200", "OK", data);
    }

    public static <T> Result<T> fail() {
        return new Result("-1", "fail", null);
    }

    public static <T> Result<T> fail(String message) {
        return new Result("-1", message, null);
    }

}
